#pragma once

#include "stdafx.h"
#include "SSE.h"


struct Float4{
	__m128 sse;
};

BBAEXPint Float4Create(){return rcast_i( _aligned_malloc(sizeof(Float4), 16) );}
BBAEXPvoid Float4Free( Float4*vec4 ){_aligned_free( vec4 );}
BBAEXPvoid Float4Set( Float4*vec4, const float a, const float b, const float c, const float d )
{vec4->sse = _mm_set_ps( d, c, b, a );}
BBAEXPfloat Float4Get( Float4*vec4, const int index ){return vec4->sse.m128_f32[index];}
BBAEXPvoid Float4Add( Float4*vec40, Float4*vec41 ){vec40->sse = _mm_add_ps( vec40->sse, vec41->sse );}
BBAEXPvoid Float4Sub( Float4*vec40, Float4*vec41 ){vec40->sse = _mm_sub_ps( vec40->sse, vec41->sse );}
BBAEXPvoid Float4Mul( Float4*vec40, Float4*vec41 ){vec40->sse = _mm_mul_ps( vec40->sse, vec41->sse );}
BBAEXPvoid Float4Div( Float4*vec40, Float4*vec41 ){vec40->sse = _mm_div_ps( vec40->sse, vec41->sse );}
BBAEXPvoid Float4Min( Float4*vec40, Float4*vec41 ){vec40->sse = _mm_min_ps( vec40->sse, vec41->sse );}
BBAEXPvoid Float4Max( Float4*vec40, Float4*vec41 ){vec40->sse = _mm_max_ps( vec40->sse, vec41->sse );}
BBAEXPvoid Float4Sqrt( Float4*vec4 ){vec4->sse = _mm_sqrt_ps( vec4->sse );}

